//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS BackupGateway service.
///
/// Backup gateway Backup gateway connects Backup to your hypervisor, so you can create, store, and restore backups of your virtual machines (VMs) anywhere, whether on-premises or in the VMware Cloud (VMC) on Amazon Web Services. Add on-premises resources by connecting to a hypervisor through a gateway. Backup will automatically discover the resources in your hypervisor. Use Backup to assign virtual or on-premises resources to a backup plan, or run on-demand backups. Once you have backed up your resources, you can view them and restore them like any resource supported by Backup. To download the Amazon Web Services software to get started, navigate to the Backup console, choose Gateways, then choose Create gateway.
public struct BackupGateway: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the BackupGateway client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "BackupOnPremises_v20210101",
            serviceName: "BackupGateway",
            serviceIdentifier: "backup-gateway",
            serviceProtocol: .json(version: "1.0"),
            apiVersion: "2021-01-01",
            endpoint: endpoint,
            errorType: BackupGatewayErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Associates a backup gateway with your server. After you complete the association process, you can back up and restore your VMs through the gateway.
    @Sendable
    @inlinable
    public func associateGatewayToServer(_ input: AssociateGatewayToServerInput, logger: Logger = AWSClient.loggingDisabled) async throws -> AssociateGatewayToServerOutput {
        try await self.client.execute(
            operation: "AssociateGatewayToServer", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Associates a backup gateway with your server. After you complete the association process, you can back up and restore your VMs through the gateway.
    ///
    /// Parameters:
    ///   - gatewayArn: The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and Amazon Web Services Region.
    ///   - serverArn: The Amazon Resource Name (ARN) of the server that hosts your virtual machines.
    ///   - logger: Logger use during operation
    @inlinable
    public func associateGatewayToServer(
        gatewayArn: String,
        serverArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> AssociateGatewayToServerOutput {
        let input = AssociateGatewayToServerInput(
            gatewayArn: gatewayArn, 
            serverArn: serverArn
        )
        return try await self.associateGatewayToServer(input, logger: logger)
    }

    /// Creates a backup gateway. After you create a gateway, you can associate it with a server using the AssociateGatewayToServer operation.
    @Sendable
    @inlinable
    public func createGateway(_ input: CreateGatewayInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateGatewayOutput {
        try await self.client.execute(
            operation: "CreateGateway", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a backup gateway. After you create a gateway, you can associate it with a server using the AssociateGatewayToServer operation.
    ///
    /// Parameters:
    ///   - activationKey: The activation key of the created gateway.
    ///   - gatewayDisplayName: The display name of the created gateway.
    ///   - gatewayType: The type of created gateway.
    ///   - tags: A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.
    ///   - logger: Logger use during operation
    @inlinable
    public func createGateway(
        activationKey: String,
        gatewayDisplayName: String,
        gatewayType: GatewayType,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateGatewayOutput {
        let input = CreateGatewayInput(
            activationKey: activationKey, 
            gatewayDisplayName: gatewayDisplayName, 
            gatewayType: gatewayType, 
            tags: tags
        )
        return try await self.createGateway(input, logger: logger)
    }

    /// Deletes a backup gateway.
    @Sendable
    @inlinable
    public func deleteGateway(_ input: DeleteGatewayInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteGatewayOutput {
        try await self.client.execute(
            operation: "DeleteGateway", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a backup gateway.
    ///
    /// Parameters:
    ///   - gatewayArn: The Amazon Resource Name (ARN) of the gateway to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteGateway(
        gatewayArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteGatewayOutput {
        let input = DeleteGatewayInput(
            gatewayArn: gatewayArn
        )
        return try await self.deleteGateway(input, logger: logger)
    }

    /// Deletes a hypervisor.
    @Sendable
    @inlinable
    public func deleteHypervisor(_ input: DeleteHypervisorInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteHypervisorOutput {
        try await self.client.execute(
            operation: "DeleteHypervisor", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a hypervisor.
    ///
    /// Parameters:
    ///   - hypervisorArn: The Amazon Resource Name (ARN) of the hypervisor to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteHypervisor(
        hypervisorArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteHypervisorOutput {
        let input = DeleteHypervisorInput(
            hypervisorArn: hypervisorArn
        )
        return try await self.deleteHypervisor(input, logger: logger)
    }

    /// Disassociates a backup gateway from the specified server. After the disassociation process finishes, the gateway can no longer access the virtual machines on the server.
    @Sendable
    @inlinable
    public func disassociateGatewayFromServer(_ input: DisassociateGatewayFromServerInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DisassociateGatewayFromServerOutput {
        try await self.client.execute(
            operation: "DisassociateGatewayFromServer", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Disassociates a backup gateway from the specified server. After the disassociation process finishes, the gateway can no longer access the virtual machines on the server.
    ///
    /// Parameters:
    ///   - gatewayArn: The Amazon Resource Name (ARN) of the gateway to disassociate.
    ///   - logger: Logger use during operation
    @inlinable
    public func disassociateGatewayFromServer(
        gatewayArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DisassociateGatewayFromServerOutput {
        let input = DisassociateGatewayFromServerInput(
            gatewayArn: gatewayArn
        )
        return try await self.disassociateGatewayFromServer(input, logger: logger)
    }

    /// Retrieves the bandwidth rate limit schedule for a specified gateway.  By default, gateways do not have bandwidth rate limit schedules, which means  no bandwidth rate limiting is in effect. Use this to get a gateway's  bandwidth rate limit schedule.
    @Sendable
    @inlinable
    public func getBandwidthRateLimitSchedule(_ input: GetBandwidthRateLimitScheduleInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetBandwidthRateLimitScheduleOutput {
        try await self.client.execute(
            operation: "GetBandwidthRateLimitSchedule", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the bandwidth rate limit schedule for a specified gateway.  By default, gateways do not have bandwidth rate limit schedules, which means  no bandwidth rate limiting is in effect. Use this to get a gateway's  bandwidth rate limit schedule.
    ///
    /// Parameters:
    ///   - gatewayArn: The Amazon Resource Name (ARN) of the gateway. Use the   ListGateways operation to return a list of gateways  for your account and Amazon Web Services Region.
    ///   - logger: Logger use during operation
    @inlinable
    public func getBandwidthRateLimitSchedule(
        gatewayArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetBandwidthRateLimitScheduleOutput {
        let input = GetBandwidthRateLimitScheduleInput(
            gatewayArn: gatewayArn
        )
        return try await self.getBandwidthRateLimitSchedule(input, logger: logger)
    }

    /// By providing the ARN (Amazon Resource Name), this API returns the gateway.
    @Sendable
    @inlinable
    public func getGateway(_ input: GetGatewayInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetGatewayOutput {
        try await self.client.execute(
            operation: "GetGateway", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// By providing the ARN (Amazon Resource Name), this API returns the gateway.
    ///
    /// Parameters:
    ///   - gatewayArn: The Amazon Resource Name (ARN) of the gateway.
    ///   - logger: Logger use during operation
    @inlinable
    public func getGateway(
        gatewayArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetGatewayOutput {
        let input = GetGatewayInput(
            gatewayArn: gatewayArn
        )
        return try await self.getGateway(input, logger: logger)
    }

    /// This action requests information about the specified hypervisor to which the gateway will connect.  A hypervisor is hardware, software, or firmware that creates and manages virtual machines,  and allocates resources to them.
    @Sendable
    @inlinable
    public func getHypervisor(_ input: GetHypervisorInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetHypervisorOutput {
        try await self.client.execute(
            operation: "GetHypervisor", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This action requests information about the specified hypervisor to which the gateway will connect.  A hypervisor is hardware, software, or firmware that creates and manages virtual machines,  and allocates resources to them.
    ///
    /// Parameters:
    ///   - hypervisorArn: The Amazon Resource Name (ARN) of the hypervisor.
    ///   - logger: Logger use during operation
    @inlinable
    public func getHypervisor(
        hypervisorArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetHypervisorOutput {
        let input = GetHypervisorInput(
            hypervisorArn: hypervisorArn
        )
        return try await self.getHypervisor(input, logger: logger)
    }

    /// This action retrieves the property mappings for the specified hypervisor.  A hypervisor property mapping displays the relationship of entity properties  available from the on-premises hypervisor to the properties available in Amazon Web Services.
    @Sendable
    @inlinable
    public func getHypervisorPropertyMappings(_ input: GetHypervisorPropertyMappingsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetHypervisorPropertyMappingsOutput {
        try await self.client.execute(
            operation: "GetHypervisorPropertyMappings", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This action retrieves the property mappings for the specified hypervisor.  A hypervisor property mapping displays the relationship of entity properties  available from the on-premises hypervisor to the properties available in Amazon Web Services.
    ///
    /// Parameters:
    ///   - hypervisorArn: The Amazon Resource Name (ARN) of the hypervisor.
    ///   - logger: Logger use during operation
    @inlinable
    public func getHypervisorPropertyMappings(
        hypervisorArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetHypervisorPropertyMappingsOutput {
        let input = GetHypervisorPropertyMappingsInput(
            hypervisorArn: hypervisorArn
        )
        return try await self.getHypervisorPropertyMappings(input, logger: logger)
    }

    /// By providing the ARN (Amazon Resource Name), this API returns the virtual machine.
    @Sendable
    @inlinable
    public func getVirtualMachine(_ input: GetVirtualMachineInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetVirtualMachineOutput {
        try await self.client.execute(
            operation: "GetVirtualMachine", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// By providing the ARN (Amazon Resource Name), this API returns the virtual machine.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the virtual machine.
    ///   - logger: Logger use during operation
    @inlinable
    public func getVirtualMachine(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetVirtualMachineOutput {
        let input = GetVirtualMachineInput(
            resourceArn: resourceArn
        )
        return try await self.getVirtualMachine(input, logger: logger)
    }

    /// Connect to a hypervisor by importing its configuration.
    @Sendable
    @inlinable
    public func importHypervisorConfiguration(_ input: ImportHypervisorConfigurationInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ImportHypervisorConfigurationOutput {
        try await self.client.execute(
            operation: "ImportHypervisorConfiguration", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Connect to a hypervisor by importing its configuration.
    ///
    /// Parameters:
    ///   - host: The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
    ///   - kmsKeyArn: The Key Management Service for the hypervisor.
    ///   - name: The name of the hypervisor.
    ///   - password: The password for the hypervisor.
    ///   - tags: The tags of the hypervisor configuration to import.
    ///   - username: The username for the hypervisor.
    ///   - logger: Logger use during operation
    @inlinable
    public func importHypervisorConfiguration(
        host: String,
        kmsKeyArn: String? = nil,
        name: String,
        password: String? = nil,
        tags: [Tag]? = nil,
        username: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ImportHypervisorConfigurationOutput {
        let input = ImportHypervisorConfigurationInput(
            host: host, 
            kmsKeyArn: kmsKeyArn, 
            name: name, 
            password: password, 
            tags: tags, 
            username: username
        )
        return try await self.importHypervisorConfiguration(input, logger: logger)
    }

    /// Lists backup gateways owned by an Amazon Web Services account in an Amazon Web Services Region. The returned list is ordered by gateway Amazon Resource Name (ARN).
    @Sendable
    @inlinable
    public func listGateways(_ input: ListGatewaysInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGatewaysOutput {
        try await self.client.execute(
            operation: "ListGateways", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists backup gateways owned by an Amazon Web Services account in an Amazon Web Services Region. The returned list is ordered by gateway Amazon Resource Name (ARN).
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of gateways to list.
    ///   - nextToken: The next item following a partial list of returned resources. For example, if a request is made to return MaxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGateways(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGatewaysOutput {
        let input = ListGatewaysInput(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listGateways(input, logger: logger)
    }

    /// Lists your hypervisors.
    @Sendable
    @inlinable
    public func listHypervisors(_ input: ListHypervisorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListHypervisorsOutput {
        try await self.client.execute(
            operation: "ListHypervisors", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists your hypervisors.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of hypervisors to list.
    ///   - nextToken: The next item following a partial list of returned resources. For example, if a request is made to return maxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
    ///   - logger: Logger use during operation
    @inlinable
    public func listHypervisors(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListHypervisorsOutput {
        let input = ListHypervisorsInput(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listHypervisors(input, logger: logger)
    }

    /// Lists the tags applied to the resource identified by its Amazon Resource Name (ARN).
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceOutput {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the tags applied to the resource identified by its Amazon Resource Name (ARN).
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource's tags to list.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceOutput {
        let input = ListTagsForResourceInput(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Lists your virtual machines.
    @Sendable
    @inlinable
    public func listVirtualMachines(_ input: ListVirtualMachinesInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListVirtualMachinesOutput {
        try await self.client.execute(
            operation: "ListVirtualMachines", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists your virtual machines.
    ///
    /// Parameters:
    ///   - hypervisorArn: The Amazon Resource Name (ARN) of the hypervisor connected to your virtual machine.
    ///   - maxResults: The maximum number of virtual machines to list.
    ///   - nextToken: The next item following a partial list of returned resources. For example, if a request is made to return maxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
    ///   - logger: Logger use during operation
    @inlinable
    public func listVirtualMachines(
        hypervisorArn: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListVirtualMachinesOutput {
        let input = ListVirtualMachinesInput(
            hypervisorArn: hypervisorArn, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listVirtualMachines(input, logger: logger)
    }

    /// This action sets the bandwidth rate limit schedule for a specified gateway.  By default, gateways do not have a bandwidth rate limit schedule, which means  no bandwidth rate limiting is in effect. Use this to initiate a   gateway's bandwidth rate limit schedule.
    @Sendable
    @inlinable
    public func putBandwidthRateLimitSchedule(_ input: PutBandwidthRateLimitScheduleInput, logger: Logger = AWSClient.loggingDisabled) async throws -> PutBandwidthRateLimitScheduleOutput {
        try await self.client.execute(
            operation: "PutBandwidthRateLimitSchedule", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This action sets the bandwidth rate limit schedule for a specified gateway.  By default, gateways do not have a bandwidth rate limit schedule, which means  no bandwidth rate limiting is in effect. Use this to initiate a   gateway's bandwidth rate limit schedule.
    ///
    /// Parameters:
    ///   - bandwidthRateLimitIntervals: An array containing bandwidth rate limit schedule intervals for a gateway.  When no bandwidth rate limit intervals have been scheduled, the array is empty.
    ///   - gatewayArn: The Amazon Resource Name (ARN) of the gateway. Use the   ListGateways operation to return a list of gateways  for your account and Amazon Web Services Region.
    ///   - logger: Logger use during operation
    @inlinable
    public func putBandwidthRateLimitSchedule(
        bandwidthRateLimitIntervals: [BandwidthRateLimitInterval],
        gatewayArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutBandwidthRateLimitScheduleOutput {
        let input = PutBandwidthRateLimitScheduleInput(
            bandwidthRateLimitIntervals: bandwidthRateLimitIntervals, 
            gatewayArn: gatewayArn
        )
        return try await self.putBandwidthRateLimitSchedule(input, logger: logger)
    }

    /// This action sets the property mappings for the specified hypervisor.  A hypervisor property mapping displays the relationship of entity properties  available from the on-premises hypervisor to the properties available in Amazon Web Services.
    @Sendable
    @inlinable
    public func putHypervisorPropertyMappings(_ input: PutHypervisorPropertyMappingsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> PutHypervisorPropertyMappingsOutput {
        try await self.client.execute(
            operation: "PutHypervisorPropertyMappings", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This action sets the property mappings for the specified hypervisor.  A hypervisor property mapping displays the relationship of entity properties  available from the on-premises hypervisor to the properties available in Amazon Web Services.
    ///
    /// Parameters:
    ///   - hypervisorArn: The Amazon Resource Name (ARN) of the hypervisor.
    ///   - iamRoleArn: The Amazon Resource Name (ARN) of the IAM role.
    ///   - vmwareToAwsTagMappings: This action requests the mappings of on-premises VMware tags to the  Amazon Web Services tags.
    ///   - logger: Logger use during operation
    @inlinable
    public func putHypervisorPropertyMappings(
        hypervisorArn: String,
        iamRoleArn: String,
        vmwareToAwsTagMappings: [VmwareToAwsTagMapping],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutHypervisorPropertyMappingsOutput {
        let input = PutHypervisorPropertyMappingsInput(
            hypervisorArn: hypervisorArn, 
            iamRoleArn: iamRoleArn, 
            vmwareToAwsTagMappings: vmwareToAwsTagMappings
        )
        return try await self.putHypervisorPropertyMappings(input, logger: logger)
    }

    /// Set the maintenance start time for a gateway.
    @Sendable
    @inlinable
    public func putMaintenanceStartTime(_ input: PutMaintenanceStartTimeInput, logger: Logger = AWSClient.loggingDisabled) async throws -> PutMaintenanceStartTimeOutput {
        try await self.client.execute(
            operation: "PutMaintenanceStartTime", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Set the maintenance start time for a gateway.
    ///
    /// Parameters:
    ///   - dayOfMonth: The day of the month start maintenance on a gateway. Valid values range from Sunday to Saturday.
    ///   - dayOfWeek: The day of the week to start maintenance on a gateway.
    ///   - gatewayArn: The Amazon Resource Name (ARN) for the gateway, used to specify its maintenance start time.
    ///   - hourOfDay: The hour of the day to start maintenance on a gateway.
    ///   - minuteOfHour: The minute of the hour to start maintenance on a gateway.
    ///   - logger: Logger use during operation
    @inlinable
    public func putMaintenanceStartTime(
        dayOfMonth: Int? = nil,
        dayOfWeek: Int? = nil,
        gatewayArn: String,
        hourOfDay: Int,
        minuteOfHour: Int,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutMaintenanceStartTimeOutput {
        let input = PutMaintenanceStartTimeInput(
            dayOfMonth: dayOfMonth, 
            dayOfWeek: dayOfWeek, 
            gatewayArn: gatewayArn, 
            hourOfDay: hourOfDay, 
            minuteOfHour: minuteOfHour
        )
        return try await self.putMaintenanceStartTime(input, logger: logger)
    }

    /// This action sends a request to sync metadata across the specified virtual machines.
    @Sendable
    @inlinable
    public func startVirtualMachinesMetadataSync(_ input: StartVirtualMachinesMetadataSyncInput, logger: Logger = AWSClient.loggingDisabled) async throws -> StartVirtualMachinesMetadataSyncOutput {
        try await self.client.execute(
            operation: "StartVirtualMachinesMetadataSync", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This action sends a request to sync metadata across the specified virtual machines.
    ///
    /// Parameters:
    ///   - hypervisorArn: The Amazon Resource Name (ARN) of the hypervisor.
    ///   - logger: Logger use during operation
    @inlinable
    public func startVirtualMachinesMetadataSync(
        hypervisorArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartVirtualMachinesMetadataSyncOutput {
        let input = StartVirtualMachinesMetadataSyncInput(
            hypervisorArn: hypervisorArn
        )
        return try await self.startVirtualMachinesMetadataSync(input, logger: logger)
    }

    /// Tag the resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceOutput {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Tag the resource.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Name (ARN) of the resource to tag.
    ///   - tags: A list of tags to assign to the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceARN: String,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceOutput {
        let input = TagResourceInput(
            resourceARN: resourceARN, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Tests your hypervisor configuration to validate that backup gateway can connect with the hypervisor and its resources.
    @Sendable
    @inlinable
    public func testHypervisorConfiguration(_ input: TestHypervisorConfigurationInput, logger: Logger = AWSClient.loggingDisabled) async throws -> TestHypervisorConfigurationOutput {
        try await self.client.execute(
            operation: "TestHypervisorConfiguration", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Tests your hypervisor configuration to validate that backup gateway can connect with the hypervisor and its resources.
    ///
    /// Parameters:
    ///   - gatewayArn: The Amazon Resource Name (ARN) of the gateway to the hypervisor to test.
    ///   - host: The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
    ///   - password: The password for the hypervisor.
    ///   - username: The username for the hypervisor.
    ///   - logger: Logger use during operation
    @inlinable
    public func testHypervisorConfiguration(
        gatewayArn: String,
        host: String,
        password: String? = nil,
        username: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TestHypervisorConfigurationOutput {
        let input = TestHypervisorConfigurationInput(
            gatewayArn: gatewayArn, 
            host: host, 
            password: password, 
            username: username
        )
        return try await self.testHypervisorConfiguration(input, logger: logger)
    }

    /// Removes tags from the resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceOutput {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes tags from the resource.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Name (ARN) of the resource from which to remove tags.
    ///   - tagKeys: The list of tag keys specifying which tags to remove.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceARN: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceOutput {
        let input = UntagResourceInput(
            resourceARN: resourceARN, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates a gateway's name. Specify which gateway to update using the Amazon Resource Name (ARN) of the gateway in your request.
    @Sendable
    @inlinable
    public func updateGatewayInformation(_ input: UpdateGatewayInformationInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateGatewayInformationOutput {
        try await self.client.execute(
            operation: "UpdateGatewayInformation", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a gateway's name. Specify which gateway to update using the Amazon Resource Name (ARN) of the gateway in your request.
    ///
    /// Parameters:
    ///   - gatewayArn: The Amazon Resource Name (ARN) of the gateway to update.
    ///   - gatewayDisplayName: The updated display name of the gateway.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateGatewayInformation(
        gatewayArn: String,
        gatewayDisplayName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateGatewayInformationOutput {
        let input = UpdateGatewayInformationInput(
            gatewayArn: gatewayArn, 
            gatewayDisplayName: gatewayDisplayName
        )
        return try await self.updateGatewayInformation(input, logger: logger)
    }

    /// Updates the gateway virtual machine (VM) software.  The request immediately triggers the software update.  When you make this request, you get a 200 OK success response immediately. However, it might take some  time for the update to complete.
    @Sendable
    @inlinable
    public func updateGatewaySoftwareNow(_ input: UpdateGatewaySoftwareNowInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateGatewaySoftwareNowOutput {
        try await self.client.execute(
            operation: "UpdateGatewaySoftwareNow", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the gateway virtual machine (VM) software.  The request immediately triggers the software update.  When you make this request, you get a 200 OK success response immediately. However, it might take some  time for the update to complete.
    ///
    /// Parameters:
    ///   - gatewayArn: The Amazon Resource Name (ARN) of the gateway to be updated.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateGatewaySoftwareNow(
        gatewayArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateGatewaySoftwareNowOutput {
        let input = UpdateGatewaySoftwareNowInput(
            gatewayArn: gatewayArn
        )
        return try await self.updateGatewaySoftwareNow(input, logger: logger)
    }

    /// Updates a hypervisor metadata, including its host, username, and password. Specify which hypervisor to update using the Amazon Resource Name (ARN) of the hypervisor in your request.
    @Sendable
    @inlinable
    public func updateHypervisor(_ input: UpdateHypervisorInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateHypervisorOutput {
        try await self.client.execute(
            operation: "UpdateHypervisor", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a hypervisor metadata, including its host, username, and password. Specify which hypervisor to update using the Amazon Resource Name (ARN) of the hypervisor in your request.
    ///
    /// Parameters:
    ///   - host: The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
    ///   - hypervisorArn: The Amazon Resource Name (ARN) of the hypervisor to update.
    ///   - logGroupArn: The Amazon Resource Name (ARN) of the group of gateways within the requested log.
    ///   - name: The updated name for the hypervisor
    ///   - password: The updated password for the hypervisor.
    ///   - username: The updated username for the hypervisor.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateHypervisor(
        host: String? = nil,
        hypervisorArn: String,
        logGroupArn: String? = nil,
        name: String? = nil,
        password: String? = nil,
        username: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateHypervisorOutput {
        let input = UpdateHypervisorInput(
            host: host, 
            hypervisorArn: hypervisorArn, 
            logGroupArn: logGroupArn, 
            name: name, 
            password: password, 
            username: username
        )
        return try await self.updateHypervisor(input, logger: logger)
    }
}

extension BackupGateway {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: BackupGateway, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}
